package br.feevale.jogo.util;

import br.feevale.jogo.view.GameView;

public class SincronizaAgentes extends Thread {
	
	private GameView gameView;
	
	public SincronizaAgentes(GameView gameView) {
		this.gameView = gameView;
	}
	
	@Override
	public void run() {
		
		while (!(gameView.setupAgente && gameView.setupAgenteAdversario)) {
			
			gameView.sendCommand(CommandEnum.BTN_PORTA);
			
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		
		interrupt();
	}
	
}
